<template>
  <view scroll-y style="padding: 50upx 30upx" class="news_detail">
    <view class="color-333">{{details.newsName}}</view>
    <view class="color-666 u-p-b-30">{{details.createTime}}</view>
    <u-parse :html="details.newsContent"></u-parse>
  </view>
</template>

<script>
  import {request} from "../../util/api";

  export default {
    onShow() {
      uni.$on('news_detail', data => {
        this.details = data.details;
      })
    },

    onUnload() {
      // 移除监听事件
      uni.$off('news_detail')
    },

    onLoad(option) {
      this.current_id = option.id
      // 更新浏览量
      request({
        url: '/system/wx/add/lookNum/' + option.id,
        token: true
      }).then(res => {
        console.log(res)
      })
    },

    data() {
      return {
        details: {}
      }
    }
  }
</script>

<style scoped>

</style>
